﻿
@model PagedList.IPagedList<demo86.Models.Result >
@using PagedList.Mvc
<link href="~/Content/PagedList.css" rel="stylesheet" />

@{
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
    ViewBag.Title = "Index";
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
</head>
<body>

    <p class="sub-header">@Html.ActionLink("添加", "Create")</p>
    @using (Html.BeginForm("Show", "Result", FormMethod.Get))
    {
        
        <p >
                    名字查找：@Html.TextBox("Search", ViewBag.CurrentFilter as string)

            <input type="submit" value="Seach" />

        </p>
       
    }
    <div>
        <div class="table-responsive">
            <table class="table table-striped">
                <thead>
                    <tr>
                        <td>
                            @Html.ActionLink("title", "Show", new { sortOrder = ViewBag.NameSortParm, currentFilter = ViewBag.CurrentFilter })
                        </td>
                        <td>
                            @Html.ActionLink("date", "Show", new { sortOrder = ViewBag.NameSortParm, currentFilter = ViewBag.CurrentFilter })
                        </td>
                        <td>
                            @Html.ActionLink("Where", "Show", new { sortOrder = ViewBag.NameSortParm, currentFilter = ViewBag.CurrentFilter })
                        </td>
                        <td>
                            @Html.ActionLink("类型", "Show", new { sortOrder = ViewBag.NameSortParm, currentFilter = ViewBag.CurrentFilter })
                        </td>
                        <td></td>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td>@Html.DisplayFor(modelItem => item.title )</td>
                            <td>@Html.DisplayFor(modelItem => item.date )</td>
                            <td>@Html.DisplayFor(modelItem => item.Where )</td>
                            <td>@Html.DisplayFor(modelItem => item.Type )</td>
                            <td>@Html.EditorFor(modelItem => item.content )</td>


                            <td>@Html.ActionLink("详情", "Details", new { id = item.ID })</td>
                            <td>@Html.ActionLink("编辑", "Edit", new { id = item.ID })</td>
                            <td>@Html.ActionLink("删除", "Delete", new { id = item.ID })</td>

                        </tr>
                    }
                </tbody>

            </table>
            <br />

            page@(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)of @Model.PageCount
            @Html.PagedListPager(Model, page => Url.Action("Show", new { page, SortDirection = ViewBag.CurrentSort,
           currentFilter = ViewBag.CurrentFilter}))

        </div>
    </div>
</body>
</html>
